package com.iplant.ams.service.po.ams;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.general.CalendarTool;

import java.io.Serializable;
import java.util.Calendar;

@DBBasePO(TableName = "ams_purchase_order", CheckName = {"Code"}, CodeAuto = true, CodePrefix = "POD_{yyyyMMdd}", CodeNum = 4)
public class AMSPurchaseOrder extends BasePO implements Serializable {

    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 供应商ID
     */
    @DBField
    @DBCondition(ParamName = "SupplierID", CompareType = DBCondition.DBCompareType.eq)
    public int SupplierID = 0;

    /**
     * 供应商名称
     */
    @DBJoin(name = "Name", tableName = "ams_supplier_info", tableAsName = "t1", ConditionalJoin = {" t1.ID=t.SupplierID"})
    public String SupplierName = "";

    /**
     * 预计到货日期
     */
    @DBField
    public Calendar DTExpectedArrival = CalendarTool.getBasicDate();

    /**
     * 当前状态
     */
    @DBField
    public int CurrentStatus = 0;

    public AMSPurchaseOrder() {
        super();
    }

    @JsonProperty("SupplierID")
    public int getSupplierID() {
        return SupplierID;
    }

    public void setSupplierID(int supplierID) {
        SupplierID = supplierID;
    }

    @JsonProperty("SupplierName")
    public String getSupplierName() {
        return SupplierName;
    }

    public void setSupplierName(String supplierName) {
        SupplierName = supplierName;
    }

    @JsonProperty("DTExpectedArrival")
    public Calendar getDTExpectedArrival() {
        return DTExpectedArrival;
    }

    public void setDTExpectedArrival(Calendar DTExpectedArrival) {
        this.DTExpectedArrival = DTExpectedArrival;
    }

    @JsonProperty("CurrentStatus")
    public int getCurrentStatus() {
        return CurrentStatus;
    }

    public void setCurrentStatus(int currentStatus) {
        CurrentStatus = currentStatus;
    }
}
